<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');?>

<!--{hook admin_user_update_start.htm}-->
<div class="container-fluid">
<div class="row">
	<div class="col-lg-8 mx-auto">
		<div class="card">
			<div class="card-body">
				<h4 class="card-title"><?php echo lang('edit_user');?></h4>
				<form action="<?php echo url('user-update', $extra, TRUE);?>" method="post" id="form">
					<?php echo $input['safe_token'];?>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label"><?php echo lang('email');?>：</label>
						<div class="col-sm-10">
							<?php echo $input['email'];?>
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label"><?php echo lang('username');?>：</label>
						<div class="col-sm-10">
							<?php echo $input['username'];?>
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label"><?php echo lang('password');?>：</label>
						<div class="col-sm-10">
							<?php echo $input['password'];?>
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label"><?php echo lang('user_group');?>：</label>
						<div class="col-sm-10">
							<?php echo $input['_gid'];?>
						</div>
					</div>
					<!--{hook admin_user_update_group_after.htm}-->
					<div class="form-group">
						<div class="col-sm-12">
							<button type="submit" class="btn btn-danger btn-block col-md-3 mx-auto" id="submit" data-loading-text="<?php echo lang('submiting');?>..."><?php echo lang('confirm');?></button>
							<a role="button" class="btn btn-secondary btn-block col-md-3 mx-auto mt-3" href="javascript:history.back();"><?php echo lang('back');?></a>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
</div>
<!--{hook admin_user_update_end.htm}-->

<?php include _include(ADMIN_PATH.'view/htm/footer.inc.htm');?>

<script>
var jform = $('#form');
jform.on('submit', function() {
	jform.reset();
    var jthis = $(this);
    var jsubmit = jthis.find('#submit');
	jsubmit.button('loading');
	var postdata = jform.serialize();
	$.xpost(jform.attr('action'), postdata, function(code, message) {
		if(code == 0) {
			$.alert(message);
			jsubmit.text(message).delay(1000).location();
		} else if(xn.is_number(code)) {
			alert(message);
			jsubmit.button('reset');
		} else {
			alert(message);
			jform.find('[name="'+code+'"]').alert(message).focus();
			jsubmit.button('reset');
		}
	});
	return false;
});

$('#user').addClass('show');
$('li.user, .menu-user').addClass('active').find('a').removeClass('collapsed');
</script>

<!--{hook admin_user_update_js.htm}-->